package com.junzhiit.nengji.api.rabbitmq;

import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

@Component
@DependsOn("rabbitmqEnum") // 依赖依 RabbitmqEnum 类， 加此注解标明 rabbitmqEnum 类先加载后再加载本类
public class RabbitMQServiceImpl extends BaseRabbitMQService implements RabbitMQService{
	
	@Override
	public void sendToStoreBusiness(String id, String content) {
		try {
			toQueue(RabbitmqEnum.Queues.SHOP_BUSINESS_RECORD.getName(), id, content);
		} catch (Exception e) {
			this.sendFailure(RabbitmqEnum.Queues.SHOP_BUSINESS_RECORD.getName(), id, content);
			logger.error("发送消息至队列服务器异常............（插入失败表, 定时扫描重发）"+ RabbitmqEnum.Queues.SHOP_BUSINESS_RECORD.getName());
			e.printStackTrace();
		}
	}
	
}
